#include "ace/INET_Addr.h"
#include "ace/SOCK_Stream.h"
#include "ace/SOCK_Connector.h"
#include "ace/Log_Msg.h"

int ACE_TMAIN(int argc, char **argv)
{
    ACE_INET_Addr srvr(12333, ACE_LOCALHOST);
    ACE_SOCK_Connector conn;
    ACE_SOCK_Stream peer;
    int bc;
    char buf[64];

    if (-1 == conn.connect(peer, srvr))
        ACE_ERROR_RETURN((LM_ERROR, ACE_TEXT("%p\n"), 
                ACE_TEXT("connect")), 1);

    peer.send_n("uptime\n", 7);
    bc = peer.recv(buf, sizeof buf);
    write(1, buf, bc);
    peer.close();

    return 0;
}
